//
//  JiShuVc.swift
//  GjCup
//
//  Created by abc on 2024/4/8.
//

import UIKit

class JiShuVc: UIViewController {
    
    
    @IBOutlet weak var numLa: UILabel!
    
    @IBOutlet weak var plusBtn: UIButton!{
        didSet{
            plusBtn.layer.cornerRadius = 6
        }
    }
    
    
    
    @IBOutlet weak var reduceBtn: UIButton!{
        didSet{
            reduceBtn.layer.cornerRadius = 6
        }
    }
    
    var num = 0{
        didSet{
            numLa.text = "\(num)"
        }
    }
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    @IBAction func clear(_ sender: UIBarButtonItem) {
        num = 0
    }
    
    @IBAction func plus(_ sender: UIButton) {
        num += 1
    }
    
    @IBAction func reduce(_ sender: UIButton) {
        num -= 1
        if num < 0 {
            num = 0
        }
    }
    
    
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
